#include "Hash.h"

namespace {
	extern "C" {
		uint32_t fnv_32a_str(const char *str, uint32_t hval);
		uint32_t fnv_32a_buf(const void *buf, size_t len, uint32_t hval);
	}
}

namespace illib {
	uint32_t Hash::Buffer(HashType type, const void * buffer, size_t len, uint32_t hash) {
		switch (type) {
		case FNV:
			return fnv_32a_buf(buffer, len, hash);
		default:
			return fnv_32a_buf(buffer, len, hash);
		}

	}
	uint32_t Hash::String(HashType type, const char* str, uint32_t hash) {
		switch (type) {
		case FNV:
			return fnv_32a_str(str, hash);
		default:
			return fnv_32a_str(str, hash);
		}
	}
}
